/**
 * Any CSS included here will be global. The classic template
 * bundles Infima by default. Infima is a CSS framework designed to
 * work well for content-centric websites.
 */

/* You can override the default Infima variables here. */
:root {
  --ifm-color-primary: #2e8555;
  --ifm-color-primary-dark: #29784c;
  --ifm-color-primary-darker: #277148;
  --ifm-color-primary-darkest: #205d3b;
  --ifm-color-primary-light: #33925d;
  --ifm-color-primary-lighter: #359962;
  --ifm-color-primary-lightest: #3cad6e;
  --ifm-code-font-size: 95%;
  --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
  --ifm-scrollbar-thumb-background-color: #ccc;
  --ifm-scrollbar-thumb-hover-background-color: #999;
  --ifm-color-emphasis-50: rgba(0, 0, 0, 0.02);
  --ifm-color-emphasis-100: rgba(0, 0, 0, 0.05);
  --ifm-color-emphasis-200: rgba(0, 0, 0, 0.1);
  --ifm-color-emphasis-300: rgba(0, 0, 0, 0.2);
  --ifm-color-emphasis-400: rgba(0, 0, 0, 0.3);
  --ifm-color-emphasis-600: rgba(0, 0, 0, 0.5);
  --ifm-color-emphasis-700: rgba(0, 0, 0, 0.6);
  --ifm-color-emphasis-800: rgba(0, 0, 0, 0.7);
  --ifm-color-emphasis-900: rgba(0, 0, 0, 0.8);
  --ifm-color-emphasis-1000: rgba(0, 0, 0, 0.9);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
  --ifm-color-primary: #25c2a0;
  --ifm-color-primary-dark: #21af90;
  --ifm-color-primary-darker: #1fa588;
  --ifm-color-primary-darkest: #1a8870;
  --ifm-color-primary-light: #29d5b0;
  --ifm-color-primary-lighter: #32d8b4;
  --ifm-color-primary-lightest: #4fddbf;
  --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
  --ifm-scrollbar-thumb-background-color: #666;
  --ifm-scrollbar-thumb-hover-background-color: #888;
  --ifm-color-emphasis-50: rgba(255, 255, 255, 0.02);
  --ifm-color-emphasis-100: rgba(255, 255, 255, 0.05);
  --ifm-color-emphasis-200: rgba(255, 255, 255, 0.1);
  --ifm-color-emphasis-300: rgba(255, 255, 255, 0.2);
  --ifm-color-emphasis-400: rgba(255, 255, 255, 0.3);
  --ifm-color-emphasis-600: rgba(255, 255, 255, 0.5);
  --ifm-color-emphasis-700: rgba(255, 255, 255, 0.6);
  --ifm-color-emphasis-800: rgba(255, 255, 255, 0.7);
  --ifm-color-emphasis-900: rgba(255, 255, 255, 0.8);
  --ifm-color-emphasis-1000: rgba(255, 255, 255, 0.9);
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ifm-scrollbar-thumb-background-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ifm-scrollbar-thumb-hover-background-color);
}

/* 针对 Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ifm-scrollbar-thumb-background-color) transparent;
}

/* 优化页面滚动行为 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* 暗色模式适配 */
[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background: var(--ifm-scrollbar-thumb-background-color);
}

[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
  background: var(--ifm-scrollbar-thumb-hover-background-color);
}

/* 文档页面样式 */
.markdown {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ifm-font-color-base);
}

/* 文档标题样式 */
.theme-doc-markdown h1 {
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2rem;
}

/* 文档内容样式 */
.theme-doc-markdown p {
  line-height: 1.8;
  margin: 1.2em 0;
}

/* 代码块样式 */
.theme-code-block {
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* 侧边栏样式 */
.theme-doc-sidebar {
  border-right: 1px solid var(--ifm-color-emphasis-200);
  will-change: transform;
  transform: translateZ(0);
}

.menu__link {
  border-radius: 6px;
  transition: all 0.2s ease;
}

.menu__link:hover {
  background: var(--ifm-color-emphasis-100);
  transform: translateX(4px);
}

.menu__link--active {
  font-weight: 600;
}

/* 面包屑导航样式 */
.breadcrumbs {
  --ifm-breadcrumb-size-multiplier: 0.8;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
}

.breadcrumbs__link {
  color: var(--ifm-color-emphasis-700);
}

.breadcrumbs__link:hover {
  color: var(--ifm-color-primary);
}

/* 导航栏样式优化 */
.navbar {
  box-shadow: none;
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
}

.navbar__brand {
  font-weight: 700;
}

.navbar__item {
  font-weight: 500;
}

.navbar__link {
  font-weight: 500;
  transition: all 0.2s ease;
}

.navbar__link:hover {
  color: var(--ifm-color-primary);
  transform: translateY(-1px);
}

/* 下拉菜单样式 */
.dropdown__menu {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  padding: 0.5rem;
}

.dropdown__link {
  border-radius: 6px;
  transition: all 0.2s ease;
  padding: 0.5rem 0.75rem;
}

.dropdown__link:hover {
  background: var(--ifm-color-emphasis-100);
  transform: translateX(4px);
}

/* 文档内容样式优化 */
.markdown > h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid var(--ifm-color-emphasis-200);
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
}

.markdown > h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
}

.markdown img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  content-visibility: auto;
  contain: content;
}

/* 代码块样式优化 */
.theme-code-block {
  background: var(--ifm-pre-background);
  border: 1px solid var(--ifm-color-emphasis-200);
  margin: 1.5rem 0;
}

.theme-code-block pre {
  background-color: transparent;
}

/* 表格样式优化 */
.markdown table {
  display: table;
  width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
}

/* 确保表格在小屏幕上可以滚动 */
.markdown .table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  border: 1px solid var(--ifm-color-emphasis-200);
}

/* 在小屏幕上的特殊处理 */
@media screen and (max-width: 768px) {
  .markdown .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  .markdown table {
    border: none;
    margin: 0;
    min-width: 100%;
  }

  .markdown table th,
  .markdown table td {
    white-space: nowrap;
    min-width: 120px;
  }
}

/* 表格单元格样式 */
.markdown table th,
.markdown table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
  text-align: left;
}

/* 表头样式 */
.markdown table th {
  background: var(--ifm-color-emphasis-100);
  font-weight: 600;
}

/* 去掉最后一行的底部边框 */
.markdown table tr:last-child td {
  border-bottom: none;
}

/* 表格悬停效果 */
.markdown table tr:hover {
  background: var(--ifm-color-emphasis-50);
}

/* 列表样式优化 */
.markdown ul li,
.markdown ol li {
  margin: 0.5rem 0;
}

/* 引用块样式 */
.markdown blockquote {
  border-left: 4px solid var(--ifm-color-primary);
  background: var(--ifm-color-emphasis-100);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

/* 标签页样式优化 */
.tabs {
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
}

.tabs__item {
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.tabs__item:hover {
  background: var(--ifm-color-emphasis-100);
}

.tabs__item--active {
  border-bottom-color: var(--ifm-color-primary);
}

/* 卡片样式 */
.card {
  border: 1px solid var(--ifm-color-emphasis-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
  .navbar__toggle {
    color: var(--ifm-color-emphasis-600);
  }
  
  .navbar-sidebar {
    box-shadow: none;
    border-right: 1px solid var(--ifm-color-emphasis-200);
  }
  
  .navbar-sidebar__brand {
    box-shadow: none;
    border-bottom: 1px solid var(--ifm-color-emphasis-200);
  }
}

/* 文档页面布局优化 */
.main-wrapper {
  width: 100%;
  max-width: 100%;
  will-change: opacity, transform;
}

/* 优化文档容器宽度 */
.container {
  max-width: 1400px;
  padding: 0 1.5rem;
}

/* TOC 目录样式优化 */
.table-of-contents {
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--ifm-background-surface-color);
  border: 1px solid var(--ifm-color-emphasis-200);
  font-size: 0.9rem;
  line-height: 1.5;
}

.table-of-contents__link {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.table-of-contents__link:hover {
  background: var(--ifm-color-emphasis-100);
  transform: translateX(4px);
}

.table-of-contents__link--active {
  font-weight: 600;
  color: var(--ifm-color-primary);
}

.table-of-contents ul {
  padding-left: 1rem;
}

.table-of-contents li {
  margin: 0.3rem 0;
}

/* 代码行高亮优化 */
.docusaurus-highlight-code-line {
  background-color: var(--ifm-color-emphasis-100);
  display: block;
  margin: 0 calc(-1 * var(--ifm-pre-padding));
  padding: 0 var(--ifm-pre-padding);
  border-left: 3px solid var(--ifm-color-primary);
}

/* 内联代码样式 */
code {
  background: var(--ifm-color-emphasis-100);
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 4px;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
}

/* 搜索框样式优化 */
.navbar__search-input {
  background: var(--ifm-background-surface-color);
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
}

.navbar__search-input:focus {
  border-color: var(--ifm-color-primary);
  box-shadow: 0 0 0 2px var(--ifm-color-primary-lighter);
}

/* 页面过渡动画 */
.main-wrapper {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 文档页脚导航 */
.pagination-nav {
  margin: 2rem 0;
}

.pagination-nav__link {
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pagination-nav__link:hover {
  border-color: var(--ifm-color-primary);
  text-decoration: none;
  transform: translateY(-2px);
}

.pagination-nav__sublabel {
  font-size: 0.8rem;
  color: var(--ifm-color-emphasis-600);
}

/* 优化 admonitions */
.alert {
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--ifm-background-surface-color);
}

.alert--info {
  border-left: 4px solid var(--ifm-color-info);
}

.alert--warning {
  border-left: 4px solid var(--ifm-color-warning);
}

.alert--danger {
  border-left: 4px solid var(--ifm-color-danger);
}

/* 优化锚点样式 */
.hash-link {
  opacity: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.hash-link:hover {
  background: var(--ifm-color-emphasis-100);
  opacity: 1;
}

h1:hover .hash-link,
h2:hover .hash-link,
h3:hover .hash-link {
  opacity: 0.7;
}

/* 优化选中文本样式 */
::selection {
  background: var(--ifm-color-primary);
  color: white;
}

/* 暗色模式特定优化 */
[data-theme='dark'] {
  --ifm-background-surface-color: #1a1a1a;
  --ifm-code-background: #2d2d2d;
}

[data-theme='dark'] .alert {
  background: var(--ifm-background-surface-color);
}

[data-theme='dark'] .navbar__search-input {
  background: var(--ifm-background-surface-color);
}

/* 优化文档阅读体验 */
.markdown {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ifm-font-color-base);
}

/* 优化标题层级视觉效果 */
.markdown h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ifm-color-emphasis-200);
}

.markdown h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.markdown h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

/* 优化列表样式 */
.markdown ul, .markdown ol {
  padding-left: 1.5rem;
}

.markdown li + li {
  margin-top: 0.5rem;
}

/* 优化链接样式 */
.markdown a:not(.hash-link) {
  border-bottom: 1px solid var(--ifm-color-primary);
  transition: all 0.2s ease;
}

.markdown a:not(.hash-link):hover {
  border-bottom-width: 2px;
  text-decoration: none;
}

/* 优化代码块标题 */
.theme-code-block-highlighted-line {
  background-color: var(--ifm-color-emphasis-200);
  display: block;
  margin: 0 calc(-1 * var(--ifm-pre-padding));
  padding: 0 var(--ifm-pre-padding);
  border-left: 3px solid var(--ifm-color-primary);
}

/* 优化内联代码在暗色模式下的显示 */
[data-theme='dark'] code {
  background: var(--ifm-code-background);
  border-color: var(--ifm-color-emphasis-300);
}

/* 优化表格在移动端的显示 */
@media screen and (max-width: 768px) {
  .markdown table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .markdown td,
  .markdown th {
    min-width: 120px;
  }
}

/* 优化页面底部导航 */
.pagination-nav__link--prev .pagination-nav__label::before {
  content: '← ';
}

.pagination-nav__link--next .pagination-nav__label::after {
  content: ' →';
}

/* 优化搜索结果样式 */
.search-result-match {
  color: var(--ifm-color-primary);
  font-weight: bold;
}

/* 优化提示框图标 */
.alert svg {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
}

/* 优化代码块工具栏 */
.theme-code-block-highlighted-line {
  opacity: 0.8;
}

.theme-code-block button {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-code-block:hover button {
  opacity: 1;
}

/* 优化图片显示 */
.markdown img {
  display: block;
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
}

/* 优化引用块样式 */
.markdown blockquote {
  font-style: italic;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  position: relative;
}

.markdown blockquote::before {
  content: '"';
  font-size: 3rem;
  position: absolute;
  left: -0.5rem;
  top: -1rem;
  opacity: 0.2;
}

/* 优化分割线样式 */
.markdown hr {
  border: none;
  border-top: 2px solid var(--ifm-color-emphasis-200);
  margin: 3rem 0;
}

/* 优化键盘快捷键样式 */
kbd {
  background: var(--ifm-color-emphasis-100);
  border: 1px solid var(--ifm-color-emphasis-300);
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  box-shadow: 0 2px 0 var(--ifm-color-emphasis-300);
}

@media print {
  .navbar,
  .theme-doc-sidebar,
  .theme-doc-footer,
  .pagination-nav {
    display: none;
  }

  .main-wrapper {
    max-width: 100%;
    padding: 0;
  }

  .markdown {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* 优化打印时的链接显示 */
  .markdown a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }
}

/* 图片悬停效果 */
.markdown img:hover {
  transform: scale(1.01);
  transition: transform 0.2s ease;
}

/* 代码块悬停效果 */
.theme-code-block:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

/* Gitee icon */
.header-gitee-link:hover {
  opacity: 0.6;
}

.header-gitee-link::before {
  content: '';
  width: 24px;
  height: 24px;
  display: flex;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z' fill='%23C71D23'/%3E%3C/svg%3E")
    no-repeat;
}

[data-theme='dark'] .header-gitee-link::before {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z' fill='%23ffffff'/%3E%3C/svg%3E")
    no-repeat;
}

/* Vue logo 样式 */
.navbar-vue-link:before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 196.32 170.02"><path fill="%2342b883" d="M120.83 0L98.16 39.26 75.49 0H0l98.16 170.02L196.32 0h-75.49z"/><path fill="%23435466" d="M120.83 0L98.16 39.26 75.49 0H39.26l58.9 102.01L157.06 0h-36.23z"/></svg>') no-repeat center center;
  background-size: contain;
  vertical-align: middle;
}
